<template>
  <div class="pane-container">
    <el-button @click="drawer = true" type="primary" style="margin: 5px;">查看数据</el-button>
    <!-- <el-button @click="isWMS" type="primary" style="margin: 5px;">显/隐WMS</el-button>
    <el-button @click="isSatellite" type="primary" style="margin: 5px;">显/隐卫星图</el-button>-->

    <el-drawer title="路线轨迹数据" :visible.sync="drawer" :before-close="handleClose">
      <el-input
        type="textarea"
        :autosize="{ minRows: 2, maxRows: 100}"
        placeholder="路线轨迹数组"
        v-model="textarea"
        :readonly="true"
      ></el-input>
    </el-drawer>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import bus from "../eventBus";
export default {
  data() {
    return {
      drawer: false,
      textarea: "轨迹数据"
    };
  },
  computed: {
    ...mapGetters(["dotArr"])
  },
  mounted() {
    let self = this;
    bus.$on("lineDataArr", res => {
      self.textarea = res;
    });
  },
  methods: {
    handleClose(done) {
      done();
    },
    isWMS() {
      this.$emit("isShowWms");
    },
    isSatellite() {
      this.$emit("isShowSatellite");
    }
  }
};
</script>

<style scoped lang="scss">
.pane-container {
  width: 108px;
  position: absolute;
  z-index: 1000;
  top: 10px;
  right: 20px;
  font-size: 0.9rem;
  box-sizing: border-box;
}
</style>